<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="js/vue.js"></script>
</head>

<body>
    <div id="h3">
        {{message}}
    </div>
    <script>
        var vm = new Vue({
            el: '#h3',
            data: {
                message: 'Hello world!'
            },
            methods: {
                show() {
                    console.log('执行了show 方法')
                }
            },
            beforeUpdate() {
                console.log(`页面上的数据： ${document.getElementById('h3').innerText}`);
                console.log(`data中的message数据：${this.message}`)
            }
        })
    </script>
</body>

</html>